import request from '@/utils/request'

// 查询菜单列表
export function findMenuList(id, name, pageIndex, pageSize, sysId) {
  return request({
    url: '/authority/auMenu/queryList',
    method: 'get',
    params: { id, name, pageIndex, pageSize, sysId }
  })
}

// 查询菜单详情
export function findMenuDetail(id) {
  return request({
    url: '/authority/auMenu/detail',
    method: 'get',
    params: { id }
  })
}

// 删除菜单
export function deleteMenu(id) {
  return request({
    url: '/authority/auMenu/delete',
    method: 'delete',
    params: { id }
  })
}

// 添加菜单
export function createMenuAdd(data) {
  return request({
    url: '/authority/auMenu/add',
    method: 'post',
    data
  })
}

// 修改菜单
export function updateMenu(data) {
  return request({
    url: '/authority/auMenu/update',
    method: 'put',
    data
  })
}

// 登录后根据用户ID和平台ID查询菜单
export function findByUserIdAndSysId(sysId) {
  return request({
    url: '/authority/auMenu/queryListByUserIdAndSysId',
    method: 'get',
    params: { sysId }
  })
}
